/*
* $Id: StringFunction.cpp 2 2009-12-23 13:58:02Z volok-aleksej@yandex.ru $
*
* Copyright 2008-2009 by Volokitin Alexey
* All rights reserved
*
*/
#include "../include.h"
#include "StringFunction.h"

std::vector<std::tstring> CStringFunction::GetStringArray(const std::tstring& strContent, const std::tstring& strSeparator){
	std::vector<std::tstring> aWord;
	size_t pos = 0;
	size_t endpos = pos;
	do {
		endpos = strContent.find(strSeparator, pos);
		if(endpos == -1){
			aWord.push_back(std::tstring(strContent.begin() + pos, strContent.end()));
			break;
		}
		aWord.push_back(std::tstring(strContent.begin() + pos, strContent.begin() + endpos));
		pos = endpos + 1;
	} while (TRUE);
	return aWord;
}